#ifndef UPDATEPROFILEREQUEST_H
#define UPDATEPROFILEREQUEST_H

#include "network/networkgetjsonrequest.h"
#include "updateprofileresponse.h"

#include <QObject>
#include <QUrl>


namespace Profile {

class UpdateProfileResponse;

class UpdateProfileRequest : public Network::GetJSONRequest
{
    Q_OBJECT
public:
    explicit UpdateProfileRequest(const QString &sessionKey);
    
private:
    Network::JSONResponse &jsonResponse();
public:
    const Network::JSONResponse &jsonResponse() const;
    QUrl url() const;


    void setProfile(QString fullName,
                    QString email,
                    QString mobile1,
                    QString mobile2,
                    QString mobile3,
                    QString gender,
                    QString googleId,
                    QString yahooId,
                    QString city,
                    QString bidthday){
        m_fullName = fullName;
        m_email = email;
        m_mobile1 = mobile1;
        m_mobile2 = mobile2;
        m_mobile3 = mobile3;
        m_gender = gender;
        m_googleId = googleId;
        m_yahooId = yahooId;
        m_city = city;
        m_birthday = bidthday;
        setGender();
    }
    void setProfile(QString fullName,
                    QString email,
                    QString gender,
                    QString bidthday){
        m_fullName = fullName;
        m_email = email;
        m_gender = gender;
        m_birthday = bidthday;
        setGender();
    }
    void setGender(){
        if(m_gender == "Nam"){
            igender = 0;
        }
        else
            igender = 1;
    }

private:
    int igender;
    QString m_sessionKey;

    QString m_fullName;
    QString m_email;
    QString m_mobile1;
    QString m_mobile2;
    QString m_mobile3;
    QString m_gender;
    QString m_googleId;
    QString m_yahooId;
    QString m_city;
    QString m_birthday;
    UpdateProfileResponse *m_response;
};

}

#endif // UPDATEPROFILEREQUEST_H
